def single_gpu_test(model,
                    data_loader,
                    show=False,
                    out_dir=None,
                    show_score_thr=0.3):
    model.eval()
    results = []
    dataset = data_loader.dataset
    prog_bar = mmcv.ProgressBar(len(dataset))
    for i, data in enumerate(data_loader):
        with torch.no_grad():
            # result = model(return_loss=False, rescale=True, **data)
            img = data['img']
            assert len(img) == 1 # no augment test
            img = img[0]
            img_metas = data['img_metas'][0].data
            img_shapes = tuple(img_metas[0][0]['img_shape'])
            img_norm_cfg = img_metas[0][0]['img_norm_cfg']
            scale_factor = img_metas[0][0]['scale_factor']

            submetas = []
            subimg = []
            H, W, _ = img_shapes
            base_points = []
            crop_w, crop_h = (600,600)
            step_w, step_h = (400,400)
            for h in range(0, H-crop_h+step_h, step_h):
                for w in range(0, W-crop_w+step_w, step_w):
                    if w + crop_w > W:
                        x1 = W - crop_w
                    if h + crop_h > H:
                        y1 = H - crop_h
                    subimg.append(img[:,:,y1:y1+crop_h,x1:x1+crop_w])
                    base_points.append([x1,y1])
                    submetas.append({
                        'ori_shape': (crop_h, crop_w, 3),
                        'img_shape': (crop_h, crop_w, 3),
                        'pad_shape': (crop_h, crop_w, 3),
                        'scale_factor': np.array([1.0,1.0,1.0,1.0]),
                        'flip': False,
                        'flip_direction': None,
                        'img_norm_cfg': img_norm_cfg
                    })
            subimg = torch.cat(subimg, dim=0)
            subdata = {'img_metas': [submetas], 'img': [subimg]}
            
            result = model(return_loss=False, rescale=True, **subdata)
            for i in range(len(result)):
                sx, sy = base_points[i]
                result[i] = list(map(lambda x: x + np.array([sx,sy,sx,sy,0]), result[i]))
            result = [np.concatenate(x, axis=0) for x in zip(*result)]

            for i in range(len(result)):
                if result[i].shape[0] != 0:
                    bbox = torch.from_numpy(result[i][:,:4]).float().contiguous()
                    scores = torch.from_numpy(result[i][:,4]).float().contiguous()
                    ids = torch.ones(bbox.size(0))
                    det_bboxes, _ = batched_nms(bbox, scores, ids, 
                        nms_cfg=dict(type='nms', iou_threshold=0.5))
                    bbox = det_bboxes[:,:4]
                    scores = det_bboxes[:,4]
                    bbox = bbox / torch.from_numpy(scale_factor)
                    result[i] = torch.cat([bbox, scores[:,None]], dim=-1).numpy()
            result = [result]

        batch_size = len(result)
        if show or out_dir:
            if batch_size == 1 and isinstance(data['img'][0], torch.Tensor):
                img_tensor = data['img'][0]
            else:
                img_tensor = data['img'][0].data[0]
            img_metas = data['img_metas'][0].data[0]
            imgs = tensor2imgs(img_tensor, **img_metas[0]['img_norm_cfg'])
            assert len(imgs) == len(img_metas)

            for i, (img, img_meta) in enumerate(zip(imgs, img_metas)):
                h, w, _ = img_meta['img_shape']
                img_show = img[:h, :w, :]

                ori_h, ori_w = img_meta['ori_shape'][:-1]
                img_show = mmcv.imresize(img_show, (ori_w, ori_h))

                if out_dir:
                    out_file = osp.join(out_dir, img_meta['ori_filename'])
                else:
                    out_file = None

                model.module.show_result(
                    img_show,
                    result[i],
                    show=show,
                    out_file=out_file,
                    score_thr=show_score_thr)

        # encode mask results
        if isinstance(result[0], tuple):
            result = [(bbox_results, encode_mask_results(mask_results))
                      for bbox_results, mask_results in result]
        results.extend(result)

        for _ in range(batch_size):
            prog_bar.update()
    return results